﻿using FigureDraw.Diagram;
using FigureDraw.Graphic;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace FigureDraw.Shapes.DataFlowShape
{
    public class InputDataFlow : MyShape
    {
        public InputDataFlow()
            : base()
        {
            brushColor = new MyColorInfo(255, 255, 255);
        }

        public InputDataFlow(MyPoint startPoint, MyPoint endPoint)
            : base(startPoint, endPoint)
        {
            brushColor = new MyColorInfo(255, 255, 255);
        }

        public override void Draw(CommonGraphic graphic)
        {
            MyRectInfo rect = MyRectInfo.Convert(startPoint, endPoint);
            graphic.DrawRectangle(rect.Position, rect.Size, strokeColor, strokeWidth, brushColor);
            graphic.DrawRectangle(new MyPoint(rect.Position.X + rect.Size.X / 10, rect.Position.Y), new MyPoint(8 * rect.Size.X / 10, rect.Size.Y), strokeColor, strokeWidth, brushColor);
        }

        public override MyShape Clone(BlockDiagram diagram)
        {
            MyShape shape = diagram.DrawInput(startPoint, endPoint);
            shape.StrokeColor = strokeColor;
            shape.StrokeWidth = strokeWidth;
            shape.BrushColor = brushColor;

            return shape; 
        }

        public override MyShape Clone()
        {
            MyShape shape = new InputDataFlow(startPoint, endPoint);
            shape.StrokeColor = strokeColor;
            shape.StrokeWidth = strokeWidth;
            shape.BrushColor = brushColor;

            return shape;
        }
    }
}
